<template>
	<view>
		<view class="bus_info tp-w690" @click="handleChooseInvoice(dateInfo.orderNo)">
			<view class="info_top-wrap">
				<view class="date">
					<text class="type">拼车</text>
					拼车时间：{{dateInfo.time}}
				</view>
				<view class="status">
					<view>已完成</view>
				</view>
			</view>
			
			<view class="info_content-wrap">
				<view class="address-wrap">
					<view class="step-wrap">
						<view class="dot dot_from"></view>
						<view class="dot dot_to"></view>
					</view>
					<view class="from">
						<text class="txt ellispsis1">{{dateInfo.startStation}}</text>
					</view>
					<view class="to">
						<text class="txt ellispsis1">{{dateInfo.endStation}}</text>
					</view>
				</view>
				<view class="price"><text style="font-size: 24rpx;">￥</text> {{dateInfo.price}}</view>
			</view>
			
			<view class="order_info-wrap">
				<view class="order_num">订单号：{{dateInfo.orderNo}}</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		props: {
			dateInfo: {
				type: Object,
				default() {
					return {}
				}
			},
			curNavbar: {
				type: [Object,Boolean],
				default() {
					return false
				}
			}
		},
		data() {
			return {
				
			};
		},
		mounted() {
			
		},
		methods: {
			// 点击回撤 携带订单号
			handleChooseInvoice(orderNo) {
				this.$store.commit('upChoosedInvoice', orderNo) // 测试订单号
				this.$store.commit('upChoosedOrderType', '1') // 订单类型
				uni.navigateBack({delta: 1});
			}
		}
	}
</script>

<style lang="scss" scoped>
.bus_info {
	background:#fff;
	border-radius:12rpx;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	margin-bottom: 20rpx;
	.info_top-wrap {
		height: 80rpx;
		display: flex;
		align-items: center;
		font-size: 26rpx;
		justify-content: space-between;
		padding: 0 20rpx;
		.date {
			color: #666;
			display: flex;
			align-items: center;
			.type {
				display: inline-block;
				width: 66rpx;
				height: 40rpx;
				line-height: 40rpx;
				text-align: center;
				background-color: #FFF2E0;
				color: $yellow;
				font-size: 22rpx;
				margin-right: 20rpx;
				border-radius: 8rpx;
			}
		}
		.status {
			color: $yellow;
		}
	}
	
	.info_content-wrap {
		display: flex;
		flex: 1;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx;
		border-top: 1px solid #ebebeb;
		border-bottom: 1px solid #ebebeb;
		.address-wrap {
			display: flex;
			flex: 1;
			flex-direction: column;
			justify-content: space-between;
			font-size: 30rpx;
			font-weight: bold;
			position: relative;
			.step-wrap {
				display: flex;
				justify-content: space-between;
				flex-direction: column;
				height: 90rpx;
				position: absolute;
				top: 6rpx;
				left: 0rpx;
				&::before {
					content: '';
					position: absolute;
					left: 50%;
					transform: translateX(-50%);
					height: 100%;
					width: 1px;
					background-color: #ccc;
				}
				.dot {
					height: 20rpx;
					width: 20rpx;
					border: 1px solid #ccc;
					border-radius: 50%;
					position: relative;
					&::before {
						content: '';
						position: absolute;
						left: 50%;
						top: 50%;
						transform: translate(-50%,-50%);
						height: 100%;
						width: 100%;
						border-radius: 50%;
						background-color: #fff;
					}
				}
			}
			.from,.to {
				display: flex;
				align-items: center;
				padding-left: 44rpx;
				.type {
					padding: 0 10rpx;
					background-color: #FFF2E0;
					color: $yellow;
					font-size: 22rpx;
					border-radius: 8rpx;
					margin-right: 20rpx;
					height: 40rpx;
					line-height: 40rpx;
					text-align: center;
				}
			}
			.from {
				margin-bottom: 20rpx;
			}
		}
		.price {
			color: $red;
			font-size: 36rpx;
			font-weight: bold;
		}
	}
	
	.order_info-wrap {
		height: 95rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		color: #666;
		padding: 0 20rpx;
		.order_num {
			font-size: 26rpx;
		}
		.btns {
			display: flex;
			align-items: center;
			justify-content: flex-end;
			.btn {
				border-radius: 12rpx;
				padding: 0 15rpx;
				height: 56rpx;
				line-height: 56rpx;
				text-align: center;
				min-width: 78rpx;
				font-size: 28rpx;
				&.cancle {
					background-color: #EBEBEB;
				}
				&.pay {
					color: #fff;
					background-color: $blue;
					margin-left: 20rpx;
				}
			}
		}
	}
}
</style>
